window.onload=function(){
	Cookies.get('userId'); // => 'value'
	var userId=Cookies.get('userId');
    var pbId=Cookies.get('pbId');	
    console.log(pbId,userId);
//获取所有cookie
Cookies.get(); // => { name: 'value' }
		 $.ajax({
		    type:"POST",
		    url:"http://www.youyiku-yishu.cn/WebApp/AppPhotoBooks/page",
		    data:{pbId:pbId,userId:userId},
		    dataType:"json",
		       beforeSend: function (XMLHttpRequest) {
		         		XMLHttpRequest.setRequestHeader("DEVICEINFO", "JxRaZezavm3HXM3d9pWnYiqqQC1SJbsU");
		       }
		  }).then(data=>{
		  	var master=data.master;
		  	console.log(data);
		  		var master=$('#master').val(master)
		 		var totalPage=data.realPage;
		
		  	  var totalPage=$('#all_page').val(totalPage);
		  	   var totalPage=$('#all_page').val();
		  	   if(totalPage==0){
		  	   	$('.Span2').html(1);
		  	   	console.log($('.Span2').html());
		  	   }else{
		  	   	 $('.Span2').html(totalPage);
		  	   }
		  	
		  	   
		    		   var style=(data.style);	    		
		        		$("head").append("<link>");
   						 css = $("head").children(":last");
   						   css.attr({
					        rel: "stylesheet",
					        type: "text/css",
					        href:"http://www.youyiku-yishu.cn/Apps/WebApp/View/default/css/photoNewBook/parentOffspring"+style+".css"
					    });
					    
					    $.getScript("../js/photoNewBook/parentOffspring"+style+".js",function(){
							});
		
		    });
	
}